﻿namespace Resharper.Abstractions.Solutions
{
  using System;
  using JetBrains.Annotations;
  using JetBrains.ProjectModel;

  /// <summary>Defines the <see cref="Solution"/> class.</summary>
  public class Solution
  {
    #region Constants and Fields

    /// <summary>The naming field.</summary>
    [CanBeNull]
    private Naming naming;

    #endregion

    #region Constructors and Destructors

    /// <summary>Initializes a new instance of the <see cref="Solution"/> class.</summary>
    /// <param name="solution">The solution.</param>
    internal Solution([NotNull] ISolution solution)
    {
      if (solution == null)
      {
        throw new ArgumentNullException("solution");
      }

      this.InternalSolution = solution;
    }

    #endregion

    #region Properties

    /// <summary>
    /// Gets the naming.
    /// </summary>
    [NotNull]
    public Naming Naming
    {
      get
      {
        if (this.naming == null)
        {
          this.naming = new Naming(this);
        }

        return this.naming;
      }
    }

    /// <summary>The solution field.</summary>
    [NotNull]
    internal ISolution InternalSolution { get; private set; }

    #endregion
  }
}